package com.indeep.user.mapper.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("app_invitation_code")
public class AppInvitationCodePO implements Serializable {

    private static final long serialVersionUID = -3787825773886692583L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String code;

    private Integer way;

    private String source;

    private Date expireTime;

    private Integer maxNum;

    private Integer curNum;

    /**
     * 创建时间-创建时自动填充
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间-创建与修改时自动填充
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public AppInvitationCodePO(String code) {
        this.code = code;
        this.way = 0;
        this.maxNum = 1000;
        this.curNum = 1000;
    }
}
